home *** CD-ROM | disk | FTP | other *** search
- { menu.pas -- Demonstrate pulldown menus }
-
- program Menu;
-
- {$R menu.res}
-
- uses WinTypes, WinProcs, WObjects;
-
- const
-
- id_Menu = 100;
-
- type
-
- MenuApplication = object(TApplication)
- procedure InitMainWindow; virtual;
- end;
-
- PMenuWindow = ^MenuWindow;
- MenuWindow = object(TWindow)
- constructor Init(AParent: PWindowsObject; ATitle: PChar);
- end;
-
- { MenuApplication }
-
- {- Initialize the application's window }
- procedure MenuApplication.InitMainWindow;
- begin
- MainWindow := New(PMenuWindow, Init(nil, 'Menu Demonstration'))
- end;
-
- { MenuWindow }
-
- {- Initialize the application's window object }
- constructor MenuWindow.Init(AParent: PWindowsObject; ATitle: PChar);
- begin
- TWindow.Init(AParent, ATitle);
- Attr.Menu := LoadMenu(HInstance, PChar(id_Menu))
- end;
-
- var
-
- MenuApp: MenuApplication;
-
- begin
- MenuApp.Init('Menu');
- MenuApp.Run;
- MenuApp.Done
- end.
-
-
- { --------------------------------------------------------------
- Copyright (c) 1991 by Tom Swan. All rights reserved.
- Revision 1.00 Date: 1/11/91
- ------------------------------------------------------------- }
-
-